light: fix symlink deletion
light: correct error code OOM
marsadm: improve check_* routines
proc: fix query of lamport clock
marsadm: use Lamport time for symlink creation
marsadm: fix detection of incompatible versions
marsadm: check attach state
marsadm: fix join-resource
marsadm: allow calling multiple functions in phases

Add infrastructure for splitting commands in multiple phases.
Usually, phase0 will check for some preconditions, while
phase1 will execute the command. The final result will only
be committed if nothing fails.

The difference to the old behaviour will only show up when combined
with 'all' resources. If anything fails in phase0, nothing will be
touched in phase1. The old behaviour could touch some resources,
but omit others when something failed.

The new behaviour is more transactional-like.
marsadm: split command "primary" into phases
marsadm: fix primary detection

The actual-*/is-primary symlink may race with the appearance
of the device. Use both conditions to be sure.