Hungary's parliament has blocked a proposal by Prime Minister Viktor Orban to bar refugees from resettling in the country.