Don't allow changing state from idle to finishing.
Fix gcc warning.
Fail log polling when shutting down.
Add missing include.
Make pom_ptime_sec() and pom_ptime_usec() return uint32_t values.