poll remote instead of sleeping

Rather than sleeping for a fixed amount of time, poll by sending
an invalid command and wait for its response.
jp2cli: check return code of jp2_enter_loader()