Robustness of controllability and recoverability of complex networks