Frequency locking of supermodes and stability of the out-of-phase locked state in 1-D and 2-D arrays of VCSELs