A wavelet-based nested iteration-inexact conjugate gradient algorithm for adaptively solving elliptic PDEs