C: teach <install> to cope with 'install_done' arriving before 'ok'

In releases built after 2014, it is possible for the 'install_done'
event to arrive before the 'ok' at the end of an installation. This
patch teaches the C install code to handle that gracefully.