fix: Infinite waiting for empty module to be built

If a module was empty, it would be put in the waiting state. Because
there are no dependencies nor commands to affect its state, it will not
be marked as complete.

The fix updates the state of the module as soon as the build function is
attempted. It will set the state to complete and as a result any modules
that rely on this module will not be put into an infinite waiting state.

Signed-off-by: Bart Kuivenhoven <bemkuivenhoven@gmail.com>