layers: Correctly remove secondary cmd buffers from in-flight

Secondary command buffers are considered executing, or "in-flight"
at the time they're bound into a primary command buffer. This leads
to a couple of corner case bugs if the primary command buffer is
never submitted on a queue. This change fixes those bugs:

1. If a secondary cmd buffer is being freed and is in the global
in-flight set, remove it if associated primary is not in-flight
2. When a primary cmd buffer is reset, remove its secondary
cmd buffers from in-flight
1 file changed