wmbattery: Restore BSD support.

Code that was ripped out of wmbattery for version 1.22, which introduced the
dependency on libapm but dropped support for the BSDs, has been restored.