Image forming apparatus and method for controlling the power saving mode