Update cachematrix.R

For project assignment 2 of Coursera R programming course