Hello,
I run in this bug too, without knowing you had the same issue. Since I saw that my device where recognized only one time out of two, and only with "allow_intrusive_scan" set to true, I started to investigate this bug. This is what I found out.
Libnfc puts PN532 in PowerDown mode when it ends its operations and sends "0x55 0x55 0x00 0x00 0x00" to wake PN532 up when it needs to operate again. Unluckly this is not enough to wake it up on some devices: infact the PN532 Manual says to send a "large preamble" to PN532 or to send a 0x55 byte and "wait a long delay" in order to wake it up. It seems that sending 5 bytes as a preamble is not long enough, so PN532 fails to be recognized on the first try because it doesn't wake up. But on the first try, with "allow_intrusive_scan" set to true, a lot of data is sent to PN532, so it's awake when one try to use it on second try. When the operations executed on second try end, libnfc put PN532 in PowerDown mode, so on the subsequent try it doesn't wake up. And so on. I think this explains the alternation.
That said, I modified the source to send "0x55 0x55 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00" (16 bytes of data), and this seems to be enough to wake it up immediately. So, I think this solution is cleaner, faster and more reliable compared to adding a sleep(). This is why I'm submitting this patch.
Regards
Marcello Morena