ensure setting the fd to blocking mode before returning it to the caller

it might have added to an iomux and the non-blocking mode flag could be on
minor fix: some logic checking the validity of the received 'magic' was in a wrong branch