s4/messaging: Return the number of previously-registered functions that are removed